package com.tpp.utils;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;

@Component
public class HeaderUtils {
        @Autowired
        RedisUtils redisUtils;
        public String getUserJson(HttpServletRequest request){
            //从token中解析出用户对象
            //1.获取header中的token
            String token = request.getHeader("token");
            String jwtToken = redisUtils.get(token).toString();
            JwtUtils jwtUtils = new JwtUtils();
            String s = jwtUtils.VerifyToekn(jwtToken);
            return s;
        }
}
